|
@@ -3,290 +3,298 @@
|
|
|
v-bind="$attrs"
|
|
|
@register="register"
|
|
|
title="新增案件"
|
|
|
- @cancel="resetFields"
|
|
|
+ @visible-change="handleVisibleChange"
|
|
|
@ok="handleSubmit"
|
|
|
- :width="1000"
|
|
|
+ :width="900"
|
|
|
:min-height="0"
|
|
|
>
|
|
|
<div class="pt-2px pr-3px">
|
|
|
- <BasicTable class="powesrTable" @register="registerTable"></BasicTable>
|
|
|
+ <div class="mx-5 BasicForm flex">
|
|
|
+ <span style="line-height: 32px; margin-right: 10px">案件名称</span>
|
|
|
+ <div class="input">
|
|
|
+ <a-input v-model:value="fileFlow.caseTitle" placeholder="请输入" />
|
|
|
+ </div>
|
|
|
+ <!-- <a-button type="primary" @click="handleAdd"> 新增</a-button> -->
|
|
|
+ </div>
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #href="{ record }">
|
|
|
+ <a
|
|
|
+ v-if="record.status == 1 || (record.status == -2 && record.payStatus == 1)"
|
|
|
+ target="_blank"
|
|
|
+ :title="record.sceneName"
|
|
|
+ :href="record.webSite"
|
|
|
+ >{{ record.sceneName }}</a
|
|
|
+ >
|
|
|
+ <span v-else-if="record.sceneName">{{ record.sceneName }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
</div>
|
|
|
</BasicModal>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, ref, computed, onMounted, reactive } from 'vue';
|
|
|
+ import { defineComponent, ref, nextTick, onMounted, reactive, h } from 'vue';
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { sceneMove } from '/@/api/operate';
|
|
|
- import { useModal } from '/@/components/Modal';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
- // import detailModal from './detailModal.vue';
|
|
|
- import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
- import { getAuthList, getAuthType, setAuthType, delAuth } from '/@/api/operate';
|
|
|
- import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
|
|
|
- import { useUserStore } from '/@/store/modules/user';
|
|
|
- import dayjs from 'dayjs';
|
|
|
+ import { getByKey, addOrUpdate, del } from '/@/api/media';
|
|
|
+ import {
|
|
|
+ BasicTable,
|
|
|
+ useTable,
|
|
|
+ TableAction,
|
|
|
+ BasicColumn,
|
|
|
+ TableImg,
|
|
|
+ FormProps,
|
|
|
+ } from '/@/components/Table';
|
|
|
+ import { caseaddOrUpdateApi, operateSceneList } from '/@/api/operate';
|
|
|
const { t } = useI18n();
|
|
|
export default defineComponent({
|
|
|
- components: { BasicModal, BasicForm, BasicTable, TableAction },
|
|
|
+ components: { BasicModal, BasicTable, TableAction },
|
|
|
props: {
|
|
|
userData: { type: Object },
|
|
|
},
|
|
|
emits: ['update', 'register'],
|
|
|
setup(props, { emit }) {
|
|
|
const modelRef = ref({});
|
|
|
- const numRef = ref(null);
|
|
|
- const type = ref(0);
|
|
|
const fileFlow = reactive({
|
|
|
- showList: true,
|
|
|
+ caseTitle: '',
|
|
|
+ file: null,
|
|
|
+ dylist: [],
|
|
|
+ mslist: [],
|
|
|
});
|
|
|
- const [registerDetail, { openModal: openDetaileModal }] = useModal();
|
|
|
const columns: BasicColumn[] = [
|
|
|
{
|
|
|
- title: '人员编号',
|
|
|
- dataIndex: 'ryNo',
|
|
|
+ title: '场景标题',
|
|
|
+ dataIndex: 'sceneName',
|
|
|
+ ellipsis: true,
|
|
|
+ slots: { customRender: 'href' },
|
|
|
+ resizable: true,
|
|
|
+ minWidth: 150,
|
|
|
width: 150,
|
|
|
},
|
|
|
{
|
|
|
- title: '姓名',
|
|
|
- dataIndex: 'ryNickName',
|
|
|
+ title: '场景码',
|
|
|
+ dataIndex: 'num',
|
|
|
+ ellipsis: true,
|
|
|
width: 180,
|
|
|
},
|
|
|
{
|
|
|
- title: '查看权限',
|
|
|
- dataIndex: 'lookAuth',
|
|
|
- customRender: ({ record }) => {
|
|
|
- return record.lookAuth == 1
|
|
|
- ? '不限时间'
|
|
|
- : record.lookAuth == 0
|
|
|
- ? '无权'
|
|
|
- : `${dayjs(record.lookEndTime).format('YYYY-MM-DD HH:mm')} 截止`;
|
|
|
- },
|
|
|
- width: 150,
|
|
|
+ title: '计算完成时间',
|
|
|
+ dataIndex: 'algorithmTime',
|
|
|
+ width: 180,
|
|
|
},
|
|
|
{
|
|
|
- title: '编辑权限',
|
|
|
- dataIndex: 'editAuth',
|
|
|
+ title: '场景大小',
|
|
|
+ dataIndex: 'sceneSize',
|
|
|
+ width: 80,
|
|
|
customRender: ({ record }) => {
|
|
|
- return record.editAuth == 1
|
|
|
- ? '不限时间'
|
|
|
- : record.editAuth == 0
|
|
|
- ? '无权'
|
|
|
- : `${dayjs(record.editEndTime).format('YYYY-MM-DD HH:mm')} 截止`;
|
|
|
+ return record.sceneSize && record.sceneSize != 0
|
|
|
+ ? h('span', { class: 'sceneSize' }, Math.ceil(record.sceneSize / 1024 / 1024) + 'M')
|
|
|
+ : '-';
|
|
|
},
|
|
|
- width: 150,
|
|
|
},
|
|
|
{
|
|
|
- title: '可授权他人',
|
|
|
- dataIndex: 'canLook',
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ width: 80,
|
|
|
customRender: ({ record }) => {
|
|
|
- if (type.value == 1 && record.canEditLook == 1) return '编辑';
|
|
|
- return record.canEditLook == 1
|
|
|
- ? '编辑和查看'
|
|
|
- : record.canAuthLook == 1
|
|
|
- ? '查看'
|
|
|
- : `无权`;
|
|
|
+ let str;
|
|
|
+ switch (record.status - 0) {
|
|
|
+ case 0:
|
|
|
+ str = '计算中';
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ str = '计算成功';
|
|
|
+ break;
|
|
|
+ case -2:
|
|
|
+ str = '计算成功';
|
|
|
+ break;
|
|
|
+ case -1:
|
|
|
+ str = '计算失败';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return record.payStatus == -2 ? '封存' : str;
|
|
|
},
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- ifShow: true,
|
|
|
- fixed: 'right',
|
|
|
- flag: 'ACTION',
|
|
|
- width: 80,
|
|
|
},
|
|
|
];
|
|
|
- const permissionStore = usePermissionStore();
|
|
|
- const userStore = useUserStore();
|
|
|
- const userName = computed(() => userStore.getUserInfo?.userName);
|
|
|
- const roleId = computed(() => userStore.getUserInfo?.roleId);
|
|
|
- const { getCheckPerm } = permissionStore;
|
|
|
- const { createMessage, createConfirm } = useMessage();
|
|
|
- const [registerTable, { reload, getRawDataSource }] = useTable({
|
|
|
- api: getAuthList,
|
|
|
- title: `场景列表`,
|
|
|
- columns: columns,
|
|
|
- useSearchForm: false,
|
|
|
- immediate: false,
|
|
|
- searchInfo: {
|
|
|
- num: numRef,
|
|
|
- authType: type,
|
|
|
- },
|
|
|
- // afterFetch: (T) => {
|
|
|
- // let { authType } = getRawDataSource();
|
|
|
- // setFieldsValue({
|
|
|
- // authType,
|
|
|
- // });
|
|
|
- // fileFlow.showList = authType ? false : true;
|
|
|
- // return T;
|
|
|
- // },
|
|
|
- showTableSetting: true,
|
|
|
- tableSetting: { fullScreen: true },
|
|
|
- showIndexColumn: false,
|
|
|
- canResize: true,
|
|
|
- rowKey: 'id',
|
|
|
- fetchSetting: {
|
|
|
- pageField: 'pageNum',
|
|
|
- sizeField: 'pageSize',
|
|
|
- listField: 'list',
|
|
|
- totalField: 'total',
|
|
|
- },
|
|
|
- });
|
|
|
const searchForm: Partial<FormProps> = {
|
|
|
- labelWidth: 100,
|
|
|
+ labelWidth: 50,
|
|
|
autoSubmitOnEnter: true,
|
|
|
autoAdvancedLine: 1,
|
|
|
schemas: [
|
|
|
{
|
|
|
field: 'sceneName',
|
|
|
- label: '案件名称',
|
|
|
+ label: '名称',
|
|
|
component: 'Input',
|
|
|
componentProps: {
|
|
|
maxLength: 100,
|
|
|
- placeholder: '请输入案件名称',
|
|
|
+ placeholder: ' 请名称搜索',
|
|
|
},
|
|
|
colProps: {
|
|
|
xl: 7,
|
|
|
xxl: 7,
|
|
|
},
|
|
|
},
|
|
|
- ],
|
|
|
- };
|
|
|
- const schemas: FormSchema[] = [
|
|
|
- {
|
|
|
- field: 'authType',
|
|
|
- component: 'RadioGroup',
|
|
|
- defaultValue: 0,
|
|
|
- componentProps: {
|
|
|
- options: [
|
|
|
- { label: '授权浏览', value: 0 },
|
|
|
- { label: '公开浏览', value: 1 },
|
|
|
- ],
|
|
|
- onChange: (value) => {
|
|
|
- type.value = value.target.value;
|
|
|
- fileFlow.showList = value.target.value ? false : true;
|
|
|
- reload();
|
|
|
+ {
|
|
|
+ field: 'isObj',
|
|
|
+ label: '类型',
|
|
|
+ component: 'Select',
|
|
|
+ // labelWidth: 50,
|
|
|
+ defaultValue: '0',
|
|
|
+ componentProps: {
|
|
|
+ allowClear: false,
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ label: '点云场景',
|
|
|
+ value: '0',
|
|
|
+ key: '0',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'Mesh 场景',
|
|
|
+ value: '1',
|
|
|
+ key: '1',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ onChange: (value) => {
|
|
|
+ reload({
|
|
|
+ searchInfo: { isObj: value },
|
|
|
+ }).then(() => {
|
|
|
+ setSelectedRowKeys(value == 0 ? fileFlow.dylist : fileFlow.mslist);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ colProps: {
|
|
|
+ xl: 7,
|
|
|
+ xxl: 7,
|
|
|
},
|
|
|
},
|
|
|
- label: '授权方式',
|
|
|
- colProps: {
|
|
|
- span: 24,
|
|
|
- },
|
|
|
- },
|
|
|
- ];
|
|
|
- const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
|
|
|
- labelWidth: 80,
|
|
|
- schemas,
|
|
|
- showActionButtonGroup: false,
|
|
|
- actionColOptions: {
|
|
|
- span: 24,
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ const { createMessage, createConfirm } = useMessage();
|
|
|
+ const [registerTable, { reload, getForm, setSelectedRowKeys }] = useTable({
|
|
|
+ api: operateSceneList,
|
|
|
+ title: ``,
|
|
|
+ showTableSetting: false,
|
|
|
+ rowSelection: { type: 'checkbox',getCheckboxProps: getRowSelection, onChange: onSelectChange },
|
|
|
+ // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
+ columns: columns,
|
|
|
+ // searchInfo: { type: tableType },
|
|
|
+ useSearchForm: true,
|
|
|
+ formConfig: searchForm,
|
|
|
+ showIndexColumn: false,
|
|
|
+ rowKey: 'num',
|
|
|
+ fetchSetting: {
|
|
|
+ pageField: 'pageNum',
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ listField: 'list',
|
|
|
+ totalField: 'total',
|
|
|
},
|
|
|
+ canResize: true,
|
|
|
});
|
|
|
onMounted(() => {});
|
|
|
let addListFunc = () => {};
|
|
|
const [register, { closeModal }] = useModalInner((data) => {
|
|
|
+ console.log(data);
|
|
|
data && onDataReceive(data);
|
|
|
});
|
|
|
-
|
|
|
- async function onDataReceive(data) {
|
|
|
+ function getRowSelection(record) {
|
|
|
+ return {
|
|
|
+ disabled: !(record.status == 1 || record.status == -2), // Column configuration not to be checked
|
|
|
+ name: record.name,}
|
|
|
+ }
|
|
|
+ function onSelectChange(selectedRowKeys: any, selectedRows: any) {
|
|
|
+ const { isObj } = getForm().getFieldsValue();
|
|
|
+ if (isObj == 0) {
|
|
|
+ fileFlow.dylist = selectedRowKeys;
|
|
|
+ } else if (isObj == 1) {
|
|
|
+ fileFlow.mslist = selectedRowKeys;
|
|
|
+ }
|
|
|
+ console.log('isObj', isObj, fileFlow);
|
|
|
+ }
|
|
|
+ function onDataReceive(data) {
|
|
|
modelRef.value = data;
|
|
|
- numRef.value = data.num;
|
|
|
- resetFields();
|
|
|
- const { authType } = await getAuthType({ num: numRef.value });
|
|
|
- fileFlow.showList = authType ? false : true;
|
|
|
- type.value = authType;
|
|
|
- setFieldsValue({
|
|
|
- type: data.sceneName,
|
|
|
- authType,
|
|
|
- });
|
|
|
- console.log(
|
|
|
- 'roleId',
|
|
|
- roleId.value,
|
|
|
- userName.value != data.userName || roleId.value != 1 || roleId.value != 45 || roleId.value != 48,
|
|
|
- );
|
|
|
- let disabled = !(
|
|
|
- userName.value == data.userName ||
|
|
|
- roleId.value == 1 ||
|
|
|
- roleId.value == 45 ||
|
|
|
- roleId.value == 48
|
|
|
- );
|
|
|
- updateSchema({
|
|
|
- field: 'authType',
|
|
|
- componentProps: {
|
|
|
- options: [
|
|
|
- { label: '授权浏览', value: 0, disabled: disabled && authType == 1 },
|
|
|
- { label: '公开浏览', value: 1, disabled: disabled && authType == 0 },
|
|
|
- ],
|
|
|
- },
|
|
|
+ fileFlow.dylist = [];
|
|
|
+ fileFlow.mslist = [];
|
|
|
+ fileFlow.caseTitle = '';
|
|
|
+ setSelectedRowKeys([]);
|
|
|
+ }
|
|
|
+ function handleAdd() {
|
|
|
+ console.log('handleAdd', fileFlow.dictName);
|
|
|
+ let params = {
|
|
|
+ dictName: fileFlow.dictName,
|
|
|
+ };
|
|
|
+ if (!fileFlow.dictName) {
|
|
|
+ return createMessage.warning('请输入名称');
|
|
|
+ }
|
|
|
+ addOrUpdate(params).then((res) => {
|
|
|
+ createMessage.success('添加成功');
|
|
|
+ fileFlow.dictName = '';
|
|
|
+ reload();
|
|
|
});
|
|
|
- reload();
|
|
|
- // setTimeout(async () => {
|
|
|
- // }, 500);
|
|
|
}
|
|
|
const handleSubmit = async () => {
|
|
|
+ if(!fileFlow.caseTitle){
|
|
|
+ return createMessage.warning('请输入场景名称')
|
|
|
+ }
|
|
|
try {
|
|
|
- const params = await validate();
|
|
|
- console.log('res', params);
|
|
|
- const res = await setAuthType({
|
|
|
- num: numRef.value,
|
|
|
- ...params,
|
|
|
- lookAuth: params.authType,
|
|
|
- });
|
|
|
+ const apiData = {
|
|
|
+ caseTitle: fileFlow.caseTitle,
|
|
|
+ sceneNumParam: [
|
|
|
+ {
|
|
|
+ type: 0,
|
|
|
+ numList: fileFlow.dylist,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ numList: fileFlow.mslist,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // snCode: params.snCode,
|
|
|
+ // num: modelRef.value.num,
|
|
|
+ };
|
|
|
+ console.log('res', apiData);
|
|
|
+ const res = await caseaddOrUpdateApi(apiData);
|
|
|
console.log('res', res);
|
|
|
closeModal();
|
|
|
- resetFields();
|
|
|
- // createMessage.success('权限设置成功');
|
|
|
+ createMessage.success('场景迁移成功。');
|
|
|
emit('update');
|
|
|
} catch (error) {
|
|
|
console.log('not passing', error);
|
|
|
}
|
|
|
};
|
|
|
- function addPowes() {
|
|
|
- openDetaileModal(true, { num: modelRef.value.num, qxType: fileFlow.showList });
|
|
|
- }
|
|
|
- function handleEdit(record: Recordable) {
|
|
|
- openDetaileModal(true, record);
|
|
|
+ function handleVisibleChange(v) {
|
|
|
+ // console.log(v);
|
|
|
+ // v && props.userData && nextTick(() => onDataReceive(props.userData));
|
|
|
}
|
|
|
async function handleDelete(record: Recordable) {
|
|
|
+ console.log('handleDelete', record);
|
|
|
createConfirm({
|
|
|
title: '删除',
|
|
|
- content: `确定要删除 ${record.ryNickName} 吗?`,
|
|
|
+ content: '确定要删除吗?',
|
|
|
onOk: async () => {
|
|
|
- await delAuth({ id: record.id });
|
|
|
- createMessage.success('删除成功');
|
|
|
- reload();
|
|
|
+ del({ id: record.id }).then(() => {
|
|
|
+ createMessage.success({
|
|
|
+ content: '删除成功',
|
|
|
+ });
|
|
|
+ reload();
|
|
|
+ });
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
return {
|
|
|
register,
|
|
|
- schemas,
|
|
|
- registerForm,
|
|
|
+ handleAdd,
|
|
|
+ registerTable,
|
|
|
model: modelRef,
|
|
|
fileFlow,
|
|
|
+ handleVisibleChange,
|
|
|
handleSubmit,
|
|
|
addListFunc,
|
|
|
- resetFields,
|
|
|
- t,
|
|
|
- getCheckPerm,
|
|
|
- handleEdit,
|
|
|
handleDelete,
|
|
|
- registerTable,
|
|
|
- registerDetail,
|
|
|
- openDetaileModal,
|
|
|
- addPowes,
|
|
|
- reload,
|
|
|
- userName,
|
|
|
+ t,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
- .powesrTable {
|
|
|
- }
|
|
|
-</style>
|