|
@@ -34,8 +34,8 @@
|
|
v-if="tabsKey === 'tab2'"
|
|
v-if="tabsKey === 'tab2'"
|
|
ref="setEVisaRef"
|
|
ref="setEVisaRef"
|
|
:info="dataInfo"
|
|
:info="dataInfo"
|
|
- @finish="getDataApi"
|
|
|
|
:type="type"
|
|
:type="type"
|
|
|
|
+ @finish="getDataApi"
|
|
/>
|
|
/>
|
|
<HcSetFormula
|
|
<HcSetFormula
|
|
v-if="tabsKey === 'tab3'"
|
|
v-if="tabsKey === 'tab3'"
|
|
@@ -47,15 +47,15 @@
|
|
v-if="tabsKey === 'tab4'"
|
|
v-if="tabsKey === 'tab4'"
|
|
ref="setDefaultRef"
|
|
ref="setDefaultRef"
|
|
:info="dataInfo"
|
|
:info="dataInfo"
|
|
- @finish="getDataApi"
|
|
|
|
:type="2"
|
|
:type="2"
|
|
|
|
+ @finish="getDataApi"
|
|
/>
|
|
/>
|
|
<HcSetPrompt
|
|
<HcSetPrompt
|
|
v-if="tabsKey === 'tab5'"
|
|
v-if="tabsKey === 'tab5'"
|
|
ref="setPromptRef"
|
|
ref="setPromptRef"
|
|
:info="dataInfo"
|
|
:info="dataInfo"
|
|
- @finish="getDataApi"
|
|
|
|
:type="2"
|
|
:type="2"
|
|
|
|
+ @finish="getDataApi"
|
|
/>
|
|
/>
|
|
</hc-card>
|
|
</hc-card>
|
|
</hc-page-split>
|
|
</hc-page-split>
|
|
@@ -63,17 +63,16 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { ref, watch } from "vue";
|
|
|
|
-import { getObjValue, isNullES } from "js-fast-way";
|
|
|
|
-import HcSetInput from "./adjust-excel/set-input.vue";
|
|
|
|
-import HcSetEVisa from "./adjust-excel/set-e-visa.vue";
|
|
|
|
-import HcSetFormula from "./adjust-excel/set-formula.vue";
|
|
|
|
-import HcSetDefault from "./adjust-excel/set-default.vue";
|
|
|
|
-import HcSetPrompt from "./adjust-excel/set-prompt.vue";
|
|
|
|
-import excelApi from "~api/exctab/exceltab";
|
|
|
|
|
|
+import { ref, watch } from 'vue'
|
|
|
|
+import { getObjValue, isNullES } from 'js-fast-way'
|
|
|
|
+import HcSetInput from './adjust-excel/set-input.vue'
|
|
|
|
+import HcSetEVisa from './adjust-excel/set-e-visa.vue'
|
|
|
|
+import HcSetFormula from './adjust-excel/set-formula.vue'
|
|
|
|
+import HcSetDefault from './adjust-excel/set-default.vue'
|
|
|
|
+import HcSetPrompt from './adjust-excel/set-prompt.vue'
|
|
|
|
+import excelApi from '~api/exctab/exceltab'
|
|
|
|
|
|
-import { useAppStore } from "~src/store";
|
|
|
|
-const store = useAppStore();
|
|
|
|
|
|
+import { useAppStore } from '~src/store'
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
info: {
|
|
info: {
|
|
type: Object,
|
|
type: Object,
|
|
@@ -81,146 +80,146 @@ const props = defineProps({
|
|
},
|
|
},
|
|
type: {
|
|
type: {
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
- default: "", //默认没有,独立表单库类型为2
|
|
|
|
|
|
+ default: '', //默认没有,独立表单库类型为2
|
|
},
|
|
},
|
|
-});
|
|
|
|
-
|
|
|
|
|
|
+})
|
|
//事件
|
|
//事件
|
|
-const emit = defineEmits(["close"]);
|
|
|
|
-
|
|
|
|
|
|
+const emit = defineEmits(['close'])
|
|
|
|
+const store = useAppStore()
|
|
//双向绑定
|
|
//双向绑定
|
|
-const isShow = defineModel("modelValue", {
|
|
|
|
|
|
+const isShow = defineModel('modelValue', {
|
|
default: false,
|
|
default: false,
|
|
-});
|
|
|
|
|
|
+})
|
|
|
|
|
|
//监听数据
|
|
//监听数据
|
|
-const dataInfo = ref(props.info);
|
|
|
|
-const type = ref(props.type);
|
|
|
|
|
|
+const dataInfo = ref(props.info)
|
|
|
|
+const type = ref(props.type)
|
|
watch(
|
|
watch(
|
|
() => [props.info, props.type],
|
|
() => [props.info, props.type],
|
|
([data, tpe]) => {
|
|
([data, tpe]) => {
|
|
- dataInfo.value = getObjValue(data);
|
|
|
|
|
|
+ dataInfo.value = getObjValue(data)
|
|
|
|
|
|
- type.value = tpe;
|
|
|
|
|
|
+ type.value = tpe
|
|
},
|
|
},
|
|
- { immediate: true, deep: true }
|
|
|
|
-);
|
|
|
|
|
|
+ { immediate: true, deep: true },
|
|
|
|
+)
|
|
|
|
|
|
//监听显示
|
|
//监听显示
|
|
watch(isShow, (val) => {
|
|
watch(isShow, (val) => {
|
|
- if (val) getDataApi();
|
|
|
|
- store.setIsShowName(false);
|
|
|
|
-});
|
|
|
|
|
|
+ if (val) getDataApi()
|
|
|
|
+ store.setIsShowName(false)
|
|
|
|
+})
|
|
|
|
|
|
//页面分割
|
|
//页面分割
|
|
-const splitOptions = { sizes: [70, 30], snapOffset: 0, minSize: [300, 300] };
|
|
|
|
|
|
+const splitOptions = { sizes: [70, 30], snapOffset: 0, minSize: [300, 300] }
|
|
|
|
|
|
//选项卡
|
|
//选项卡
|
|
-const tabsKey = ref("tab1");
|
|
|
|
|
|
+const tabsKey = ref('tab1')
|
|
const tabsProps = [
|
|
const tabsProps = [
|
|
- { label: "输入框", value: "tab1" },
|
|
|
|
- { label: "电签位置", value: "tab2" },
|
|
|
|
- { label: "公式条件", value: "tab3" },
|
|
|
|
- { label: "默认信息", value: "tab4" },
|
|
|
|
- { label: "提示信息", value: "tab5" },
|
|
|
|
-];
|
|
|
|
|
|
+ { label: '输入框', value: 'tab1' },
|
|
|
|
+ { label: '电签位置', value: 'tab2' },
|
|
|
|
+ { label: '公式条件', value: 'tab3' },
|
|
|
|
+ { label: '默认信息', value: 'tab4' },
|
|
|
|
+ { label: '提示信息', value: 'tab5' },
|
|
|
|
+]
|
|
|
|
|
|
//处理相关数据
|
|
//处理相关数据
|
|
-const excelRef = ref(null);
|
|
|
|
-const excelHtml = ref("");
|
|
|
|
|
|
+const excelRef = ref(null)
|
|
|
|
+const excelHtml = ref('')
|
|
const getDataApi = async () => {
|
|
const getDataApi = async () => {
|
|
const { pkeyId, excelId, primaryKeyId, excelIds } = getObjValue(
|
|
const { pkeyId, excelId, primaryKeyId, excelIds } = getObjValue(
|
|
- dataInfo.value
|
|
|
|
- );
|
|
|
|
|
|
+ dataInfo.value,
|
|
|
|
+ )
|
|
if (type.value !== 2) {
|
|
if (type.value !== 2) {
|
|
if (isNullES(pkeyId) || isNullES(excelId)) {
|
|
if (isNullES(pkeyId) || isNullES(excelId)) {
|
|
- tableFormLoading.value = false;
|
|
|
|
- window?.$message.warning("表单值异常,请联系管理员");
|
|
|
|
- return;
|
|
|
|
|
|
+ tableFormLoading.value = false
|
|
|
|
+ window?.$message.warning('表单值异常,请联系管理员')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if (isNullES(primaryKeyId) || isNullES(excelIds)) {
|
|
if (isNullES(primaryKeyId) || isNullES(excelIds)) {
|
|
- tableFormLoading.value = false;
|
|
|
|
- window?.$message.warning("表单值异常,请联系管理员");
|
|
|
|
- return;
|
|
|
|
|
|
+ tableFormLoading.value = false
|
|
|
|
+ window?.$message.warning('表单值异常,请联系管理员')
|
|
|
|
+ return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const { data } = await excelApi.getExcelHtml({
|
|
const { data } = await excelApi.getExcelHtml({
|
|
pkeyId: pkeyId ? pkeyId : primaryKeyId,
|
|
pkeyId: pkeyId ? pkeyId : primaryKeyId,
|
|
- });
|
|
|
|
- excelHtml.value = data || "";
|
|
|
|
-};
|
|
|
|
|
|
+ })
|
|
|
|
+ excelHtml.value = data || ''
|
|
|
|
+}
|
|
|
|
|
|
//ref
|
|
//ref
|
|
-const setInputRef = ref(null);
|
|
|
|
-const setEVisaRef = ref(null);
|
|
|
|
-const setFormulaRef = ref(null);
|
|
|
|
-const setDefaultRef = ref(null);
|
|
|
|
-const setPromptRef = ref(null);
|
|
|
|
|
|
+const setInputRef = ref(null)
|
|
|
|
+const setEVisaRef = ref(null)
|
|
|
|
+const setFormulaRef = ref(null)
|
|
|
|
+const setDefaultRef = ref(null)
|
|
|
|
+const setPromptRef = ref(null)
|
|
|
|
|
|
//框框被点击
|
|
//框框被点击
|
|
const keys = [
|
|
const keys = [
|
|
- "type",
|
|
|
|
- "key",
|
|
|
|
- "tr",
|
|
|
|
- "td",
|
|
|
|
- "index",
|
|
|
|
- "x1",
|
|
|
|
- "y1",
|
|
|
|
- "x2",
|
|
|
|
- "y2",
|
|
|
|
- "name",
|
|
|
|
- "text",
|
|
|
|
- "rows",
|
|
|
|
- "format",
|
|
|
|
- "tip",
|
|
|
|
- "weighing",
|
|
|
|
- "label",
|
|
|
|
- "value",
|
|
|
|
- "src",
|
|
|
|
- "val",
|
|
|
|
- "contractid",
|
|
|
|
- "pkeyid",
|
|
|
|
- "objs",
|
|
|
|
- "range",
|
|
|
|
- "def",
|
|
|
|
- "max",
|
|
|
|
-];
|
|
|
|
|
|
+ 'type',
|
|
|
|
+ 'key',
|
|
|
|
+ 'tr',
|
|
|
|
+ 'td',
|
|
|
|
+ 'index',
|
|
|
|
+ 'x1',
|
|
|
|
+ 'y1',
|
|
|
|
+ 'x2',
|
|
|
|
+ 'y2',
|
|
|
|
+ 'name',
|
|
|
|
+ 'text',
|
|
|
|
+ 'rows',
|
|
|
|
+ 'format',
|
|
|
|
+ 'tip',
|
|
|
|
+ 'weighing',
|
|
|
|
+ 'label',
|
|
|
|
+ 'value',
|
|
|
|
+ 'src',
|
|
|
|
+ 'val',
|
|
|
|
+ 'contractid',
|
|
|
|
+ 'pkeyid',
|
|
|
|
+ 'objs',
|
|
|
|
+ 'range',
|
|
|
|
+ 'def',
|
|
|
|
+ 'max',
|
|
|
|
+]
|
|
const excelClick = async (item) => {
|
|
const excelClick = async (item) => {
|
|
- const dom = item?.target;
|
|
|
|
- let obj = { zdom: item };
|
|
|
|
|
|
+ const dom = item?.target
|
|
|
|
+ let obj = { zdom: item }
|
|
for (let i = 0; i < keys.length; i++) {
|
|
for (let i = 0; i < keys.length; i++) {
|
|
- obj[keys[i]] = await getAttribute(dom, keys[i]);
|
|
|
|
|
|
+ obj[keys[i]] = await getAttribute(dom, keys[i])
|
|
}
|
|
}
|
|
- if (tabsKey.value === "tab1") {
|
|
|
|
|
|
+ if (tabsKey.value === 'tab1') {
|
|
//设置输入框
|
|
//设置输入框
|
|
- setInputRef.value?.setDomData(obj);
|
|
|
|
- } else if (tabsKey.value === "tab2") {
|
|
|
|
|
|
+ setInputRef.value?.setDomData(obj)
|
|
|
|
+ } else if (tabsKey.value === 'tab2') {
|
|
//电签
|
|
//电签
|
|
- setEVisaRef.value?.setDomData(obj);
|
|
|
|
- } else if (tabsKey.value === "tab4") {
|
|
|
|
|
|
+ setEVisaRef.value?.setDomData(obj)
|
|
|
|
+ } else if (tabsKey.value === 'tab4') {
|
|
//默认信息
|
|
//默认信息
|
|
- setDefaultRef.value?.setDomData(obj);
|
|
|
|
- } else if (tabsKey.value === "tab5") {
|
|
|
|
|
|
+ setDefaultRef.value?.setDomData(obj)
|
|
|
|
+ } else if (tabsKey.value === 'tab5') {
|
|
//提示信息
|
|
//提示信息
|
|
- setPromptRef.value?.setDomData(obj);
|
|
|
|
|
|
+ setPromptRef.value?.setDomData(obj)
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
//获取属性
|
|
//获取属性
|
|
const getAttribute = async (dom, key) => {
|
|
const getAttribute = async (dom, key) => {
|
|
try {
|
|
try {
|
|
- return dom?.getAttribute(`data-${key}`);
|
|
|
|
|
|
+ return dom?.getAttribute(`data-${key}`)
|
|
} catch (e) {
|
|
} catch (e) {
|
|
- return null;
|
|
|
|
|
|
+ return null
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
//关闭抽屉
|
|
//关闭抽屉
|
|
const drawerClose = () => {
|
|
const drawerClose = () => {
|
|
- isShow.value = false;
|
|
|
|
- emit("close");
|
|
|
|
-};
|
|
|
|
|
|
+ isShow.value = false
|
|
|
|
+ store.setIsShowName(true)
|
|
|
|
+ emit('close')
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|