| @@ -21,6 +21,8 @@ import '@/assets/icon/icons.css' | |||
| import checkPer from '@/utils/permission' | |||
| import permission from './components/Permission' | |||
| import { setToken } from '@/utils/auth' | |||
| import moment from 'moment' | |||
| Vue.prototype.$moment = moment | |||
| Vue.use(checkPer) | |||
| Vue.use(permission) | |||
| @@ -45,41 +47,3 @@ if (!window.__POWERED_BY_QIANKUN__) { | |||
| // 全局变量来判断环境 | |||
| render() | |||
| } | |||
| /** | |||
| * bootstrap 只会在微应用初始化的时候调用一次,下次微应用重新进入时会直接调用 mount 钩子,不会再重复触发 bootstrap。 | |||
| * 通常我们可以在这里做一些全局变量的初始化,比如不会在 unmount 阶段被销毁的应用级别的缓存等。 | |||
| */ | |||
| export async function bootstrap() { | |||
| console.log('现在进入子应用content-cloud的bootstraped阶段') | |||
| } | |||
| /** | |||
| * 应用每次进入都会调用 mount 方法,通常我们在这里触发应用的渲染方法 | |||
| */ | |||
| export async function mount(props) { | |||
| console.log('现在进入子应用content-cloud的mount周期', props) | |||
| setToken(props.token) | |||
| store.dispatch('user/setChild', false ) | |||
| store.dispatch('user/setRoles', props.roles ) | |||
| store.dispatch('user/setToken', props.token ) | |||
| render(props) | |||
| } | |||
| /** | |||
| * 应用每次 切出/卸载 会调用的方法,通常在这里我们会卸载微应用的应用实例 | |||
| */ | |||
| export async function unmount() { | |||
| console.log('现在进入子应用content-cloud的unmount阶段') | |||
| instance.$destroy() | |||
| instance.$el.innerHTML = '' | |||
| instance = null | |||
| // router = null | |||
| } | |||
| /** | |||
| * 可选生命周期钩子,仅使用 loadMicroApp 方式加载微应用时生效 | |||
| */ | |||
| export async function update(props) { | |||
| console.log('update props', props) | |||
| } | |||
| @@ -32,7 +32,12 @@ | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" prop="image" label="视频地址" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间"> | |||
| <template slot-scope="scope"> | |||
| {{ $moment(scope.row.sendDate).format('YYYY-MM-DD HH:mm:ss') }} | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" align="center" prop="status" label="发布状态"> | |||
| <template slot-scope="scope"> | |||
| {{ scope.row.status === 1 ? '未发布' : '已发布' }} | |||
| @@ -174,7 +179,7 @@ export default { | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.video = item?.video || '' | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.sendDate = item?.sendDate || '' | |||
| this.ruleForm.sendDate = item?.sendDate ? this.$moment(item.sendDate).format('YYYY-MM-DD HH:mm:ss') : '' | |||
| this.dialogVisible = true | |||
| }, | |||
| close(tag) { | |||
| @@ -32,7 +32,11 @@ | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" prop="image" label="视频地址" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间"> | |||
| <template slot-scope="scope"> | |||
| {{ $moment(scope.row.sendDate).format('YYYY-MM-DD HH:mm:ss') }} | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" align="center" prop="status" label="发布状态"> | |||
| <template slot-scope="scope"> | |||
| {{ scope.row.status === 1 ? '未发布' : '已发布' }} | |||
| @@ -174,7 +178,7 @@ export default { | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.video = item?.video || '' | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.sendDate = item?.sendDate || '' | |||
| this.ruleForm.sendDate = item?.sendDate ? this.$moment(item.sendDate).format('YYYY-MM-DD HH:mm:ss') : '' | |||
| this.dialogVisible = true | |||
| }, | |||
| close(tag) { | |||
| @@ -37,7 +37,11 @@ | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" prop="image" label="视频地址" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间"> | |||
| <template slot-scope="scope"> | |||
| {{ $moment(scope.row.sendDate).format('YYYY-MM-DD HH:mm:ss') }} | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" align="center" prop="status" label="发布状态"> | |||
| <template slot-scope="scope"> | |||
| {{ scope.row.status === 1 ? '未发布' : '已发布' }} | |||
| @@ -189,7 +193,7 @@ export default { | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.video = item?.video || '' | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.sendDate = item?.sendDate || '' | |||
| this.ruleForm.sendDate = item?.sendDate ? this.$moment(item.sendDate).format('YYYY-MM-DD HH:mm:ss') : '' | |||
| this.dialogVisible = true | |||
| }, | |||
| close(tag) { | |||
| @@ -37,7 +37,11 @@ | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" prop="image" label="视频地址" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间" /> | |||
| <el-table-column :show-overflow-tooltip="true" prop="sendDate" label="发布时间"> | |||
| <template slot-scope="scope"> | |||
| {{ $moment(scope.row.sendDate).format('YYYY-MM-DD HH:mm:ss') }} | |||
| </template> | |||
| </el-table-column> | |||
| <el-table-column :show-overflow-tooltip="true" align="center" prop="status" label="发布状态"> | |||
| <template slot-scope="scope"> | |||
| {{ scope.row.status === 1 ? '未发布' : '已发布' }} | |||
| @@ -181,7 +185,7 @@ export default { | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.video = item?.video || '' | |||
| this.ruleForm.detail = item?.detail || '' | |||
| this.ruleForm.sendDate = item?.sendDate || '' | |||
| this.ruleForm.sendDate = item?.sendDate ? this.$moment(item.sendDate).format('YYYY-MM-DD HH:mm:ss') : '' | |||
| this.dialogVisible = true | |||
| }, | |||
| close(tag) { | |||